<!-- HTML header for doxygen 1.9.1-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.9.4" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>NumCpp: ClusterMaker.hpp Source File</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
    <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
    <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
    <!-- ... other metadata & script includes ... -->
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeDarkModeToggle.init()
    </script>
    <script type="text/javascript"
        src="../doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeFragmentCopyButton.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-paragraph-link.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeParagraphLink.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-interactive-toc.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeInteractiveToc.init()
    </script>
</head>
<body>
    <div id="top">
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr style="height: 56px;">
                        <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png" /></td>
                        <td id="projectalign" style="padding-left: 0.5em;">
                            <div id="projectname">NumCpp
                                &#160;<span id="projectnumber">2.12.1</span>
                            </div>
                            <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part --><!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('_cluster_maker_8hpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">ClusterMaker.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="_cluster_maker_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#include &lt;set&gt;</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#include &quot;<a class="code" href="_error_8hpp.html">NumCpp/Core/Internal/Error.hpp</a>&quot;</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#include &quot;<a class="code" href="_static_asserts_8hpp.html">NumCpp/Core/Internal/StaticAsserts.hpp</a>&quot;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#include &quot;<a class="code" href="_types_8hpp.html">NumCpp/Core/Types.hpp</a>&quot;</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#include &quot;<a class="code" href="_cluster_8hpp.html">NumCpp/ImageProcessing/Cluster.hpp</a>&quot;</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#include &quot;<a class="code" href="_nd_array_8hpp.html">NumCpp/NdArray.hpp</a>&quot;</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacenc_1_1image_processing.html">nc::imageProcessing</a></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>{</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    <span class="comment">// Class Description:</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="comment"></span>    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> dtype&gt;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html">   50</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classnc_1_1image_processing_1_1_cluster_maker.html">ClusterMaker</a></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>        STATIC_ASSERT_ARITHMETIC(dtype);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>        <span class="comment">//================================Typedefs=====================================</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">   57</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">const_iterator</a> = <span class="keyword">typename</span> std::vector&lt;Cluster&lt;dtype&gt;&gt;<a class="code hl_typedef" href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">::const_iterator</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#a17c7a9f6260f7d6d0aea002b7e5e6ae6">   67</a></span><span class="comment"></span>        <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#a17c7a9f6260f7d6d0aea002b7e5e6ae6">ClusterMaker</a>(<span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1_nd_array.html">NdArray&lt;bool&gt;</a>* <span class="keyword">const</span>  inXcdArrayPtr,</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>                     <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1_nd_array.html">NdArray&lt;dtype&gt;</a>* <span class="keyword">const</span> inIntensityArrayPtr,</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>                     <a class="code hl_typedef" href="namespacenc.html#a9ba5a0aa26753a185985b8273fb9062d">uint8</a>                       inBorderWidth = 0) :</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>            xcds_(inXcdArrayPtr),</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>            intensities_(inIntensityArrayPtr)</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>        {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>            <span class="keywordflow">if</span> (xcds_-&gt;<a class="code hl_function" href="classnc_1_1_nd_array.html#a4824e91b22bb46ebc31c9c08de55ef13">shape</a>() != intensities_-&gt;shape())</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>            {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>                <a class="code hl_define" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input xcd and intensity arrays must be the same shape.&quot;</span>);</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>            }</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>            shape_ = xcds_-&gt;<a class="code hl_function" href="classnc_1_1_nd_array.html#a4824e91b22bb46ebc31c9c08de55ef13">shape</a>();</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>            <span class="comment">// convert the NdArray of booleans to a vector of exceedances</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            <span class="keywordflow">for</span> (<a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> row = 0; row &lt; shape_.<a class="code hl_variable" href="classnc_1_1_shape.html#a6f89f699dea6eb89eef19e00c92b223a">rows</a>; ++row)</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>            {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>                <span class="keywordflow">for</span> (<a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> col = 0; col &lt; shape_.<a class="code hl_variable" href="classnc_1_1_shape.html#aae1a3c997648aacaefb60d0e6d0bf10d">cols</a>; ++col)</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>                {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>                    <span class="keywordflow">if</span> (xcds_-&gt;operator()(row, col))</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>                    {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>                        <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1image_processing_1_1_pixel.html">Pixel&lt;dtype&gt;</a> thePixel(row, col, intensities_-&gt;operator()(row, col));</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>                        xcdsVec_.push_back(thePixel);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>                    }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>                }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>            }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>            runClusterMaker();</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>            <span class="keywordflow">for</span> (<a class="code hl_typedef" href="namespacenc.html#a9ba5a0aa26753a185985b8273fb9062d">uint8</a> i = 0; i &lt; inBorderWidth; ++i)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>            {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>                expandClusters();</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>            }</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>        }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#ae437071bfc291a36745d043ddd4cba1d">  107</a></span><span class="comment"></span>        <a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#ae437071bfc291a36745d043ddd4cba1d">size</a>() noexcept</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>        {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>            <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a><span class="keyword">&gt;</span>(clusters_.size());</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>        }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#ac197c22f0caa854abc78bd5a02d91f39">  120</a></span><span class="comment"></span>        <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1image_processing_1_1_cluster.html">Cluster&lt;dtype&gt;</a>&amp; <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#ac197c22f0caa854abc78bd5a02d91f39">operator[]</a>(<a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> inIndex) <span class="keyword">const</span> <span class="keyword">noexcept</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>        {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>            <span class="keywordflow">return</span> clusters_[inIndex];</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>        }</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#aa32e1c0323231d374efe444fb2bf618d">  133</a></span><span class="comment"></span>        [[nodiscard]] <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1image_processing_1_1_cluster.html">Cluster&lt;dtype&gt;</a>&amp; <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#aa32e1c0323231d374efe444fb2bf618d">at</a>(<a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> inIndex)<span class="keyword"> const</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>            <span class="keywordflow">if</span> (inIndex &gt;= clusters_.size())</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>            {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>                <a class="code hl_define" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;index exceeds cluster size.&quot;</span>);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>            }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>            <span class="keywordflow">return</span> clusters_[inIndex];</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>        }</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#a37c172d7253190e76b065ed2547c3020">  148</a></span><span class="comment"></span>        [[nodiscard]] <a class="code hl_typedef" href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">const_iterator</a> <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#a37c172d7253190e76b065ed2547c3020">begin</a>() const noexcept</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>        {</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>            <span class="keywordflow">return</span> clusters_.cbegin();</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>        }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"><a class="line" href="classnc_1_1image_processing_1_1_cluster_maker.html#a7d5ceccddb2db3b143c772ec9d66460a">  159</a></span><span class="comment"></span>        [[nodiscard]] <a class="code hl_typedef" href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">const_iterator</a> <a class="code hl_function" href="classnc_1_1image_processing_1_1_cluster_maker.html#a7d5ceccddb2db3b143c772ec9d66460a">end</a>() const noexcept</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>            <span class="keywordflow">return</span> clusters_.cend();</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>        }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>        <span class="comment">//==================================Attributes=================================</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>        <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1_nd_array.html">NdArray&lt;bool&gt;</a>* <span class="keyword">const</span>  xcds_{};</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>        <span class="keyword">const</span> <a class="code hl_class" href="classnc_1_1_nd_array.html">NdArray&lt;dtype&gt;</a>* <span class="keyword">const</span> intensities_{};</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>        std::vector&lt;Pixel&lt;dtype&gt;&gt;   xcdsVec_{};</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span> </div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>        Shape shape_{};</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>        std::vector&lt;Cluster&lt;dtype&gt;&gt; clusters_{};</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span><span class="comment"></span>        Pixel&lt;dtype&gt; makePixel(<a class="code hl_typedef" href="namespacenc.html#a9386099a0fdc2bc9fb0dbfde5606584d">int32</a> inRow, <a class="code hl_typedef" href="namespacenc.html#a9386099a0fdc2bc9fb0dbfde5606584d">int32</a> inCol) <span class="keyword">noexcept</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>        {</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>            <span class="comment">// Make sure that on the edges after i&#39;ve added or subtracted 1 from the row and col that</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>            <span class="comment">// i haven&#39;t gone over the edge</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span>            <span class="keyword">const</span> <a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> row       = <a class="code hl_function" href="namespacenc.html#a10ee4cd59b844c5dd99106a5dee12009">std::min</a>(<span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a><span class="keyword">&gt;</span>(std::max&lt;int32&gt;(inRow, 0)), shape_.<a class="code hl_variable" href="classnc_1_1_shape.html#a6f89f699dea6eb89eef19e00c92b223a">rows</a> - 1);</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>            <span class="keyword">const</span> <a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> col       = <a class="code hl_function" href="namespacenc.html#a10ee4cd59b844c5dd99106a5dee12009">std::min</a>(<span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a><span class="keyword">&gt;</span>(std::max&lt;int32&gt;(inCol, 0)), shape_.<a class="code hl_variable" href="classnc_1_1_shape.html#aae1a3c997648aacaefb60d0e6d0bf10d">cols</a> - 1);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>            <span class="keyword">const</span> dtype  intensity = intensities_-&gt;operator()(row, col);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span> </div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>            <span class="keywordflow">return</span> Pixel&lt;dtype&gt;(row, col, intensity);</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>        }</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span> </div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span><span class="comment"></span>        <span class="keywordtype">void</span> findNeighbors(<span class="keyword">const</span> Pixel&lt;dtype&gt;&amp; inPixel, std::set&lt;Pixel&lt;dtype&gt;&gt;&amp; outNeighbors)</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>        {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>            <span class="comment">// using a set will auto take care of adding duplicate pixels on the edges</span></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>            <span class="comment">// the 8 surrounding neighbors</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>            <span class="keyword">const</span> <span class="keyword">auto</span> row = <span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#a9386099a0fdc2bc9fb0dbfde5606584d">int32</a><span class="keyword">&gt;</span>(inPixel.row);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span>            <span class="keyword">const</span> <span class="keyword">auto</span> col = <span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#a9386099a0fdc2bc9fb0dbfde5606584d">int32</a><span class="keyword">&gt;</span>(inPixel.col);</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row - 1, col - 1));</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row - 1, col));</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row - 1, col + 1));</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row, col - 1));</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row, col + 1));</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row + 1, col - 1));</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row + 1, col));</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>            outNeighbors.insert(outNeighbors.end(), makePixel(row + 1, col + 1));</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>        }</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span><span class="comment"></span>        <span class="keywordtype">void</span> findNeighborNotXcds(<span class="keyword">const</span> Pixel&lt;dtype&gt;&amp; inPixel, std::vector&lt;Pixel&lt;dtype&gt;&gt;&amp; outNeighbors)</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>        {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>            std::set&lt;Pixel&lt;dtype&gt;&gt; neighbors;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>            findNeighbors(inPixel, neighbors);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span> </div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>            <span class="comment">// check if the neighboring pixels are exceedances and insert into the xcd vector</span></div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; pixel : neighbors)</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>            {</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>                <span class="keywordflow">if</span> (!xcds_-&gt;operator()(pixel.row, pixel.col))</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>                {</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>                    outNeighbors.push_back(pixel);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>                }</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>            }</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>        }</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span> </div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span><span class="comment"></span>        <span class="keywordtype">void</span> findNeighborXcds(<span class="keyword">const</span> Pixel&lt;dtype&gt;&amp; inPixel, std::vector&lt;uint32&gt;&amp; outNeighbors)</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>        {</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>            std::set&lt;Pixel&lt;dtype&gt;&gt; neighbors;</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>            findNeighbors(inPixel, neighbors);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>            std::vector&lt;Pixel&lt;dtype&gt;&gt; neighborXcds;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span> </div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>            <span class="comment">// check if the neighboring pixels are exceedances and insert into the xcd vector</span></div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; pixel : neighbors)</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>            {</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>                <span class="keywordflow">if</span> (xcds_-&gt;operator()(pixel.row, pixel.col))</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span>                {</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span>                    neighborXcds.push_back(pixel);</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span>                }</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>            }</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>            <span class="comment">// loop through the neighbors and find the cooresponding index into exceedances_</span></div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; pixel : neighborXcds)</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>            {</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>                <span class="keyword">auto</span> theExceedanceIter = <a class="code hl_function" href="namespacenc_1_1stl__algorithms.html#a761aa9f3bd88f019c46fe6cece93ade2">std::find</a>(xcdsVec_.begin(), xcdsVec_.end(), pixel);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>                outNeighbors.push_back(<span class="keyword">static_cast&lt;</span><a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a><span class="keyword">&gt;</span>(theExceedanceIter - xcdsVec_.begin()));</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>            }</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>        }</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span> </div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span><span class="comment"></span>        <span class="keywordtype">void</span> runClusterMaker()</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno">  281</span>        {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span>            <a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> clusterId = 0;</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span> </div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; currentPixel : xcdsVec_)</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span>            {</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span>                <span class="comment">// not already visited</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span>                <span class="keywordflow">if</span> (currentPixel.clusterId == -1)</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span>                {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno">  289</span>                    Cluster&lt;dtype&gt; newCluster(clusterId); <span class="comment">// a new cluster</span></div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span>                    currentPixel.clusterId = clusterId;</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno">  291</span>                    newCluster.addPixel(currentPixel); <span class="comment">// assign pixel to cluster</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>                    <span class="comment">// get the neighbors</span></div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>                    std::vector&lt;uint32&gt; neighborIds;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span>                    findNeighborXcds(currentPixel, neighborIds);</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno">  296</span>                    <span class="keywordflow">if</span> (neighborIds.empty())</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span>                    {</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span>                        clusters_.push_back(newCluster);</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>                        ++clusterId;</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>                        <span class="keywordflow">continue</span>;</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span>                    }</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span> </div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span>                    <span class="comment">// loop through the neighbors</span></div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span>                    <span class="keywordflow">for</span> (<a class="code hl_typedef" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> neighborsIdx = 0; neighborsIdx &lt; neighborIds.size(); ++neighborsIdx)</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>                    {</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span>                        Pixel&lt;dtype&gt;&amp; currentNeighborPixel = xcdsVec_[neighborIds[neighborsIdx]];</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno">  308</span>                        <span class="comment">// go to neighbors</span></div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno">  309</span>                        std::vector&lt;uint32&gt; newNeighborIds;</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>                        findNeighborXcds(currentNeighborPixel, newNeighborIds);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span> </div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>                        <span class="comment">// loop through the new neighbors and add them to neighbors</span></div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>                        <span class="keywordflow">for</span> (<span class="keyword">auto</span> newNeighborId : newNeighborIds)</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>                        {</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>                            <span class="comment">// not already in neighbors</span></div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>                            <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacenc_1_1stl__algorithms.html#a761aa9f3bd88f019c46fe6cece93ade2">std::find</a>(neighborIds.begin(), neighborIds.end(), newNeighborId) == neighborIds.end())</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>                            {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>                                neighborIds.push_back(newNeighborId);</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span>                            }</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno">  320</span>                        }</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span> </div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>                        <span class="comment">// not already assigned to a cluster</span></div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>                        <span class="keywordflow">if</span> (currentNeighborPixel.clusterId == -1)</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span>                        {</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span>                            currentNeighborPixel.clusterId = clusterId;</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span>                            newCluster.addPixel(currentNeighborPixel);</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno">  327</span>                        }</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno">  328</span>                    }</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno">  329</span> </div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span>                    clusters_.push_back(std::move(newCluster));</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span>                    ++clusterId;</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span>                }</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span>            }</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno">  334</span>        }</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span> </div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>        <span class="comment">//=============================================================================</span></div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span>        <span class="comment">// Description:</span></div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno">  340</span><span class="comment"></span>        <span class="keywordtype">void</span> expandClusters()</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno">  341</span>        {</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno">  342</span>            <span class="comment">// loop through the clusters</span></div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno">  343</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; theCluster : clusters_)</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno">  344</span>            {</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno">  345</span>                <span class="comment">// loop through the pixels of the cluster</span></div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno">  346</span>                <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; thePixel : theCluster)</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno">  347</span>                {</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span>                    std::vector&lt;Pixel&lt;dtype&gt;&gt; neighborsNotXcds;</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno">  349</span>                    findNeighborNotXcds(thePixel, neighborsNotXcds);</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno">  350</span> </div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span>                    <span class="comment">// loop through the neighbors and if they haven&#39;t already been added to the cluster, add them</span></div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span>                    <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; newPixel : neighborsNotXcds)</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span>                    {</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno">  354</span>                        <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacenc_1_1stl__algorithms.html#a761aa9f3bd88f019c46fe6cece93ade2">std::find</a>(theCluster.begin(), theCluster.end(), newPixel) == theCluster.end())</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno">  355</span>                        {</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno">  356</span>                            theCluster.addPixel(newPixel);</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno">  357</span>                        }</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno">  358</span>                    }</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span>                }</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno">  360</span>            }</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>        }</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span>    };</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span>} <span class="comment">// namespace nc::imageProcessing</span></div>
<div class="ttc" id="a_cluster_8hpp_html"><div class="ttname"><a href="_cluster_8hpp.html">Cluster.hpp</a></div></div>
<div class="ttc" id="a_error_8hpp_html"><div class="ttname"><a href="_error_8hpp.html">Error.hpp</a></div></div>
<div class="ttc" id="a_error_8hpp_html_af2aff1172060367b9c5398fa097fa8fd"><div class="ttname"><a href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a></div><div class="ttdeci">#define THROW_INVALID_ARGUMENT_ERROR(msg)</div><div class="ttdef"><b>Definition:</b> Error.hpp:37</div></div>
<div class="ttc" id="a_nd_array_8hpp_html"><div class="ttname"><a href="_nd_array_8hpp.html">NdArray.hpp</a></div></div>
<div class="ttc" id="a_static_asserts_8hpp_html"><div class="ttname"><a href="_static_asserts_8hpp.html">StaticAsserts.hpp</a></div></div>
<div class="ttc" id="a_types_8hpp_html"><div class="ttname"><a href="_types_8hpp.html">Types.hpp</a></div></div>
<div class="ttc" id="aclassnc_1_1_nd_array_html"><div class="ttname"><a href="classnc_1_1_nd_array.html">nc::NdArray&lt; bool &gt;</a></div></div>
<div class="ttc" id="aclassnc_1_1_nd_array_html_a4824e91b22bb46ebc31c9c08de55ef13"><div class="ttname"><a href="classnc_1_1_nd_array.html#a4824e91b22bb46ebc31c9c08de55ef13">nc::NdArray::shape</a></div><div class="ttdeci">const Shape &amp; shape() const noexcept</div><div class="ttdef"><b>Definition:</b> NdArrayCore.hpp:4511</div></div>
<div class="ttc" id="aclassnc_1_1_shape_html_a6f89f699dea6eb89eef19e00c92b223a"><div class="ttname"><a href="classnc_1_1_shape.html#a6f89f699dea6eb89eef19e00c92b223a">nc::Shape::rows</a></div><div class="ttdeci">uint32 rows</div><div class="ttdef"><b>Definition:</b> Core/Shape.hpp:44</div></div>
<div class="ttc" id="aclassnc_1_1_shape_html_aae1a3c997648aacaefb60d0e6d0bf10d"><div class="ttname"><a href="classnc_1_1_shape.html#aae1a3c997648aacaefb60d0e6d0bf10d">nc::Shape::cols</a></div><div class="ttdeci">uint32 cols</div><div class="ttdef"><b>Definition:</b> Core/Shape.hpp:45</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_html"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster.html">nc::imageProcessing::Cluster</a></div><div class="ttdoc">Holds the information for a cluster of pixels.</div><div class="ttdef"><b>Definition:</b> Cluster.hpp:53</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html">nc::imageProcessing::ClusterMaker</a></div><div class="ttdoc">Clusters exceedance data into contiguous groups.</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:51</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_a17c7a9f6260f7d6d0aea002b7e5e6ae6"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#a17c7a9f6260f7d6d0aea002b7e5e6ae6">nc::imageProcessing::ClusterMaker::ClusterMaker</a></div><div class="ttdeci">ClusterMaker(const NdArray&lt; bool &gt; *const inXcdArrayPtr, const NdArray&lt; dtype &gt; *const inIntensityArrayPtr, uint8 inBorderWidth=0)</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:67</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_a37c172d7253190e76b065ed2547c3020"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#a37c172d7253190e76b065ed2547c3020">nc::imageProcessing::ClusterMaker::begin</a></div><div class="ttdeci">const_iterator begin() const noexcept</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:148</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_a7d5ceccddb2db3b143c772ec9d66460a"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#a7d5ceccddb2db3b143c772ec9d66460a">nc::imageProcessing::ClusterMaker::end</a></div><div class="ttdeci">const_iterator end() const noexcept</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:159</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_a870aeb2f713b4efba22a2f978704c215"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#a870aeb2f713b4efba22a2f978704c215">nc::imageProcessing::ClusterMaker::const_iterator</a></div><div class="ttdeci">typename std::vector&lt; Cluster&lt; dtype &gt; &gt;::const_iterator const_iterator</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:57</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_aa32e1c0323231d374efe444fb2bf618d"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#aa32e1c0323231d374efe444fb2bf618d">nc::imageProcessing::ClusterMaker::at</a></div><div class="ttdeci">const Cluster&lt; dtype &gt; &amp; at(uint32 inIndex) const</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:133</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_ac197c22f0caa854abc78bd5a02d91f39"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#ac197c22f0caa854abc78bd5a02d91f39">nc::imageProcessing::ClusterMaker::operator[]</a></div><div class="ttdeci">const Cluster&lt; dtype &gt; &amp; operator[](uint32 inIndex) const noexcept</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:120</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_cluster_maker_html_ae437071bfc291a36745d043ddd4cba1d"><div class="ttname"><a href="classnc_1_1image_processing_1_1_cluster_maker.html#ae437071bfc291a36745d043ddd4cba1d">nc::imageProcessing::ClusterMaker::size</a></div><div class="ttdeci">uint32 size() noexcept</div><div class="ttdef"><b>Definition:</b> ClusterMaker.hpp:107</div></div>
<div class="ttc" id="aclassnc_1_1image_processing_1_1_pixel_html"><div class="ttname"><a href="classnc_1_1image_processing_1_1_pixel.html">nc::imageProcessing::Pixel</a></div><div class="ttdoc">Holds the information for a single pixel.</div><div class="ttdef"><b>Definition:</b> Pixel.hpp:46</div></div>
<div class="ttc" id="anamespacenc_1_1image_processing_html"><div class="ttname"><a href="namespacenc_1_1image_processing.html">nc::imageProcessing</a></div><div class="ttdef"><b>Definition:</b> applyThreshold.hpp:34</div></div>
<div class="ttc" id="anamespacenc_1_1stl__algorithms_html_a761aa9f3bd88f019c46fe6cece93ade2"><div class="ttname"><a href="namespacenc_1_1stl__algorithms.html#a761aa9f3bd88f019c46fe6cece93ade2">nc::stl_algorithms::find</a></div><div class="ttdeci">InputIt find(InputIt first, InputIt last, const T &amp;value) noexcept</div><div class="ttdef"><b>Definition:</b> StlAlgorithms.hpp:205</div></div>
<div class="ttc" id="anamespacenc_html_a10ee4cd59b844c5dd99106a5dee12009"><div class="ttname"><a href="namespacenc.html#a10ee4cd59b844c5dd99106a5dee12009">nc::min</a></div><div class="ttdeci">NdArray&lt; dtype &gt; min(const NdArray&lt; dtype &gt; &amp;inArray, Axis inAxis=Axis::NONE)</div><div class="ttdef"><b>Definition:</b> min.hpp:44</div></div>
<div class="ttc" id="anamespacenc_html_a9386099a0fdc2bc9fb0dbfde5606584d"><div class="ttname"><a href="namespacenc.html#a9386099a0fdc2bc9fb0dbfde5606584d">nc::int32</a></div><div class="ttdeci">std::int32_t int32</div><div class="ttdef"><b>Definition:</b> Types.hpp:36</div></div>
<div class="ttc" id="anamespacenc_html_a9ba5a0aa26753a185985b8273fb9062d"><div class="ttname"><a href="namespacenc.html#a9ba5a0aa26753a185985b8273fb9062d">nc::uint8</a></div><div class="ttdeci">std::uint8_t uint8</div><div class="ttdef"><b>Definition:</b> Types.hpp:42</div></div>
<div class="ttc" id="anamespacenc_html_af0f49663fb63332596e2e6327009d581"><div class="ttname"><a href="namespacenc.html#af0f49663fb63332596e2e6327009d581">nc::uint32</a></div><div class="ttdeci">std::uint32_t uint32</div><div class="ttdef"><b>Definition:</b> Types.hpp:40</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_34171bd951b13a53aa9f237277a18e40.html">NumCpp</a></li><li class="navelem"><a class="el" href="dir_d4391026049f7aede16e9c18d53d30b9.html">ImageProcessing</a></li><li class="navelem"><a class="el" href="_cluster_maker_8hpp.html">ClusterMaker.hpp</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
